import Vue from "vue";
import VueRouter from "vue-router";
import Login from "../views/login/Index.vue";
import TabBar from "../views/tabBar/Index.vue";
// 引入四个子路由页面
import Home from "../views/home/Index.vue";
import Answer from "../views/answer/Index.vue";
import Video from "../views/video/Index.vue";
import My from "../views/my/Index.vue";
import Goods from "../views/goods/Goods.vue";
Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    name: "Login",
    component: Login,
  },
  {
    path: "/",
    name: "TabBar",
    component: TabBar,
    children: [
      { path: "", component: Home },
      { path: "/answer", component: Answer },
      { path: "/video", component: Video },
      { path: "/my", component: My },
      { path: "/goods", component: Goods },
    ],
  }
];

const router = new VueRouter({
  routes,
});

export default router;
